package com.atguigu.behavior.responsibilitychain;

public class RequestClient {
    public static void main(String[] args) {
        PurchaseRequest request = new PurchaseRequest("回旋加速器", 100000L);

        processRequest(request);
    }

    public static void processRequest(PurchaseRequest purchaseRequest){
        DepartmentApprover departmentApprover = new DepartmentApprover("张三");
        CollegeApprover collegeApprover = new CollegeApprover("李四");
        ViceSchoolMasterApprover viceSchoolMasterApprover = new ViceSchoolMasterApprover("王五");
        SchoolMasterApprover schoolMasterApprover = new SchoolMasterApprover("钱六");

        departmentApprover.setNextApprover(collegeApprover);
        collegeApprover.setNextApprover(viceSchoolMasterApprover);
        viceSchoolMasterApprover.setNextApprover(schoolMasterApprover);

        departmentApprover.processRequest(purchaseRequest);
    }
}
